package ro.msg.quiz.domain;

import java.util.ArrayList;
import java.util.List;

//AUTHOR: Marco,Razvan,Elod

//Object that has id, quiz name, list of questions of different types
public class Quiz {
    private int id;
    private String name;
    private List<Question> questionList;

    public Quiz(int id, String name) {
	this.setId(id);
	this.setName(name);
	this.questionList = new ArrayList<Question>();
    }

    /**
     * @return the id
     */
    public int getId() {
	return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public void setId(int id) {
	this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
	return name;
    }

    /**
     * @param name
     *            the name to set
     */
    public void setName(String name) {
	this.name = name;
    }

    /**
     * @return the questionList
     */
    public List<Question> getQuestionList() {
	return questionList;
    }

    /**
     * @return the size of questionList
     */
    public int getNrOfQuestions() {
	return questionList.size();
    }

    /**
     * @param questionList
     *            the questionList to set
     */
    public void setQuestionList(List<Question> questionList) {
	this.questionList = questionList;
    }

    /**
     * @param q
     *            the q to add to questionList
     */
    public void addQuestion(Question q) {
	this.questionList.add(q);
    }

    @Override
    public String toString() {
	return this.id + " " + this.name + " " + this.questionList;
    }

}
